import { Component, OnInit } from '@angular/core';
import {Carousel} from "../../model/Carousel";

@Component({
  selector: 'app-carousel',
  templateUrl: './carousel.component.html',
  styleUrls: ['./carousel.component.css']
})
export class CarouselComponent implements OnInit {
 images:Array<string>;
 c1:Array<Carousel>;
  constructor() {
    this.images=[
          "http://localhost:8080/public/img/c1.jpg",
          "http://localhost:8080/public/img/c2.jpg",
          "http://localhost:8080/public/img/c3.jpg",
          "http://localhost:8080/public/img/c4.jpg",
          "http://localhost:8080/public/img/c5.jpg",
          "http://localhost:8080/public/img/c6.jpg"
        ]
    for(let i=1;i<6;i++){
      let c=new Carousel();
      c.url='http://localhost:4200/newsdetail;newsid=d4856589-c3b5-421d-862a-9363dc9a83bf';
      c.title="标题"+i;
      c.picture="http://localhost:8080/public/img/c"+i+".jpg";
      this.c1.push(c);
    }




  }

  ngOnInit(): void {
  }

}
